<include file="Public:header" />
<style>
	.header{display:none;}
	.w790{margin-top:0px;}
</style>
<div class="container main"> <include file="Public:left" />
  <div class="w790">
  <script>
  	function uploaded(path){
		$("#img_url").attr("src",'__PUBLIC__'+path);
		$("input[name='img_url']").val(path);
	}
	
	function del_img(){
		if(confirm('您确定要删除图片吗?')){
			var file=$("input[name='img_url']").val();
			$.post("{:U('delImgBypath')}",{'path':file},function(data){
				$("input[name='img_url']").val('');
				$("#img_url").attr('src','');
			});
		}else{
			return false;
		}
	}
	//删除图组图片
	function mdel_img(path){
		$('#img_list div img').each(function(index, element) {
			$.post("{:U('delImgBypath')}",{'path':path},function(data){
				
					
					$('#img_list div').each(function(index, element) {
                        if($(this).attr('url')==path){
							$(this).remove();
						}
                    });
					
					$('#picmsg input').each(function(index, element) {
                        if($(this).val()==path){
							$(this).remove();
						}
                    });
			
			});
		});
	}
	
	
	$(document).ready(function(e) {
    $('#control li').each(function(index, element) {
        $(this).click(function(e) {
			$(this).parent().find('li').removeClass('cur');
            $(this).addClass('cur');
			$('.setting_table').hide();
			$('.setting_table').eq(index).show();
        });
    });
});
function relateListadd(id,title,cate_name){
	//防止重复
	if(!$('#relateList input[value="'+id+'"]').length>0){
		$('<li>'+id+'<input type="hidden" name="relateid[]" value="'+id+'" /><input type="hidden" name="relatecate_name[]" value="'+cate_name+'" /><input size="70" type="text" name="relatetitle[]" value="'+title+'" /><a href="javascript:void(0);" onclick="after(this);">上</a><a href="javascript:void(0);" onclick="append(this);">下</a><span id="relateListdel'+id+'" class="relateListdel" onclick="relateListdel('+id+');">×</span></li>').appendTo('#relateList');
	}
}
function after(e){
	$(e).parent('li').after($(e).parent('li').prev());
}
function append(e){
	$(e).parent('li').next().after($(e).parent('li'));
}
function relateListdel(id){
	$('#relateListdel'+id).parent('li').remove();
}
function showRelate(){
			    art.dialog.open('{:U('News/relate')}', {width: 600, height: 400, ok:function(){
					
				}});
			}
  </script>
  <!--<h1><a href="{:U('index',array('id'=>$formId))}">返回列表</a><eq name="category['name']" value=""><else/>-添加"{$category['title']}"列表数据</eq></h1>-->
  
  <!--扩展切换-->
  <style>
		#control li{float:left; height:40px; line-height:40px; border:1px solid #558fca; border-bottom:none;}
		#control li a{padding:0px 8px;}
		#control li.cur{background:#558fca;}
		#control li.cur a{color:#fff; font-weight:bold;}
		.relateListdel{display:inline-block; width:20px; height:20px; text-align:center; font-size:18px; cursor:default;}
	</style>
   <ul id="control">
   <volist name="extendsField" id="vo">
   	<li><a href="javascript:void(0);">{$vo.title}</a></li>
   </volist>
   <div class="clear"></div>
   </ul>
  <!---->
    <form id="forms" class="checkoutform1" action="{:U('insert')}" method="post"><input type="hidden" name="is_list" value="1" />
      <div class="table_"><table class="table table-bordered" width="100%" border="0" cellspacing="0" class="setting_table" cellpadding="0">
      <tr>
        <td align="right">表单显示名称</td>
        <td><input datatype="*" style="display:none;" value="{$formId}" name="form_id" type="text" id="title" size="70" style="width:120px;">
        <input datatype="*" name="name" type="text" id="name" size="70" style="width:120px;"></td>
        <td>&nbsp;</td>
      </tr> 
      <tr>
        <td align="right">ID属性</td>
        <td>
        <input datatype="*" name="f_id" type="text" id="fid" size="70" style="width:120px;"></td>
        <td>&nbsp;</td>
      </tr> 
      <tr>
        <td align="right">名称属性</td>
        <td>
        <input datatype="*" name="f_name" type="text" id="fname" size="70" style="width:120px;"></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td align="right">类型属性</td>
        <td>
        <input datatype="*" name="f_type" type="radio" value="1" id="text" size="70" style="width:20px;">文本框 
         <input datatype="*" name="f_type" type="radio" value="2" id="file" size="70" style="width:20px;">文件域
         <input datatype="*" name="f_type" type="radio" value="3" id="radio" size="70" style="width:20px;">单选框 
         <input datatype="*" name="f_type" type="radio" value="4" id="checkbox" size="70" style="width:20px;">复选框
         
         <input datatype="*" name="f_type" <eq name="field['f_type']" value="8">checked</eq> type="radio" value="8" size="70" style="width:20px;">时间控件
         <input datatype="*" name="f_type" <eq name="field['f_type']" value="9">checked</eq> type="radio" value="9" size="70" style="width:20px;">客户选择控件
         
         <input datatype="*" name="f_type" <eq name="field['f_type']" value="10">checked</eq> type="radio" value="10" size="70" style="width:20px;">用户选择控件
         <input datatype="*" name="f_type" type="radio" value="6" id="verify" size="70" style="width:20px;">验证码 
         <input datatype="*" name="f_type" type="radio" value="7" id="submit" size="70" style="width:20px;">提交按钮 
         
         
         
         <input datatype="*" name="f_type" type="radio" value="5" id="text" size="70" style="width:20px;">文本域 </td>
        <td>&nbsp;
        	<div id="radios" style="display:none; width:250px;"><input placeholder="值" style='width:80px; margin-bottom:5px;' name='val[]' />=><input placeholder=\"标签\" style='width:80px; margin-bottom:5px;' name='lebal[]' /><input style="float:right;" type="button" id="add" value="添加" /></div>
        </td>
      </tr> 
      <tr>
        <td align="right">验证规则</td>
        <td>
        <input name="verify" type="text" id="title" size="70"  style="width:120px;"></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td align="right">验证信息</td>
        <td>
        <input name="verify_hint" type="text" id="verify_hint" size="70"  style="width:120px;"></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td colspan="3" align="left"><div id="img_list"></div></td>
      </tr>
     </table>
      
      <!--扩展开始-->
      </div>
      <!--扩展结束-->
      <div class="pages"><button id="sub" type="submit" class="mybutton">提交</button></div>
      
    </form>
  </div>
  <div class="clear"></div>
</div>


<script>
	$(function(){
		
		//按钮的点击事件
		$("input[name=f_type]").click(function(){
			var raid = $("input[name='f_type']:checked").attr("id");
			if(raid.trim()=="radio" || raid.trim()=="checkbox"){					
				$("#radios").show();
			}else{
				$("#radios").hide();
			}
		});
			
		//添加input text元素事件
		$("#add").click(function(){
			var input = "<input placeholder=\"值\" style='width:80px; margin-bottom:5px;' name='val[]' />=><input style='width:80px; margin-bottom:5px;' placeholder=\"标签\" name='lebal[]' /><br>";
			$("#radios").append(input);
		});
		
		//表单提交操作
		$("#sub").click(function(){
			var values = $("input[name='r']");
			var input = "<input style='display:none;' name='valueList' id='valueList'  />";
			$("#forms").submit();
		});
		
    });
</script>

</body></html>